package cn.ytxy.double_system_data_visualization_demo.user.mapper;

import cn.ytxy.double_system_data_visualization_demo.user.pojo.dto.UserQuery;
import cn.ytxy.double_system_data_visualization_demo.user.pojo.dto.UserSaveParam;
import cn.ytxy.double_system_data_visualization_demo.user.pojo.entity.User;
import cn.ytxy.double_system_data_visualization_demo.user.pojo.vo.UserVO;
import org.apache.el.parser.Token;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/*该注解加在数据层接口上,表示该类拥有对数据库CRUD的权限*/
/*Create创建 Read读取 Update更新 Delete删除*/
@Repository
public interface UserMapper {
    UserVO selectByUserName(String userName);

    List<UserVO> selectUser(UserQuery userQuery);

    void saveUser(User user);

    void insertUser(User user);

    void updateUser(User user);

    void deleteUser(Long id);

    User selectById(Long id);

    void updateUserDepartmentName(String oldDepartmentName, String newDepartmentName);

    void updateTokenByUserName(@Param("token") String token, @Param("username")String username);

    String selectToken(String token);
}
